# -*- coding: utf-8 -*-

def consumer():
    while True:
        x = yield
        print('处理了数据：', x)


def producer():
    c = consumer()
    c.__next__()
    for i in range(10):
        print('生产的数据：', i)
        c.send(i)


if __name__ == '__main__':
    producer()
